Skip to content

Mobile partner messaging fixes#3459

Open
marcusljf wants to merge 2 commits intomainfrom
program-partner-messages
Open

Mobile partner messaging fixes#3459
marcusljf wants to merge 2 commits intomainfrom
program-partner-messages

Conversation

@marcusljf
Copy link
Collaborator

@marcusljf marcusljf commented Feb 11, 2026

For both programs and partners a few issues were happening on smaller screens:

  • When clicking "new message" and it shows the partner/program drawer, after selecting a partner/program, nothing else shows. It should open the compose window, with the message input in focus.
  • When you select and existing conversation, the far panel opens over the conversation and you need to close it to see the thread.
  • Program only When you click the menu button in the top left, it opens the nav panel, but everything is hidden until you click on the partner icon again, and it takes you back to the program overview. on larger screens this makes sense, but on mobile we need to show the full nav.
CleanShot.2026-02-11.at.14.26.21.mp4

Summary by CodeRabbit

  • New Features
    • Message composer auto-focuses when creating new messages via a dedicated entry point (including mobile).
    • Right panel now auto-opens/closes responsively to improve mobile/tablet layout.
    • Navigation flow updated when switching programs or partners to open the main messages panel.
    • URL state cleaned up after opening the composer for a smoother back/forward experience.

For both programs and partners a few issues were happening on smaller screens:
- When clicking "new message" and it shows the partner/program drawer, after selecting a partner/program, nothing else shows. It should open the compose window, with the message input in focus.
- When you select and existing conversation, the far panel opens over the conversation and you need to close it to see the thread.
- `Program only` When you click the menu button in the top left, it opens the nav panel, but everything is hidden until you click on the partner icon again, and it takes you back to the program overview. on larger screens this makes sense, but on mobile we need to show the full nav.
@vercel
Copy link
Contributor

vercel bot commented Feb 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dub Ready Ready Preview Feb 12, 2026 7:20pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 11, 2026

📝 Walkthrough

Walkthrough

Adds URL-driven composer autofocus (via ?new=1) and responsive right-panel initialization based on viewport width; passes an autoFocusComposer prop into MessagesPanel and synchronizes panel state when program/partner selection changes.

Changes

Cohort / File(s) Summary
Partners dashboard messages
apps/web/app/(ee)/partners.dub.co/(dashboard)/messages/[programSlug]/page-client.tsx, apps/web/app/(ee)/partners.dub.co/(dashboard)/messages/layout.tsx
Add media-query-driven right-panel open/close behavior (threshold 1082px), derive shouldAutoFocusComposer from ?new=1, navigate/replace to clean URL, and set currentPanel to "main" when selecting a program.
App dashboard messages
apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/messages/[partnerId]/page-client.tsx, apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/messages/layout.tsx
Introduce useMediaQuery-driven panel open state (>=960px), derive shouldAutoFocusComposer from ?new=1 and replace URL to remove it, and set currentPanel to "main" when selecting a partner (navigation appends ?new=1).
Shared UI & Sidebar
apps/web/ui/messages/messages-panel.tsx, apps/web/ui/layout/sidebar/app-sidebar-nav.tsx
Add autoFocusComposer?: boolean prop to MessagesPanel; MessageInput autofocus now uses `!isMobile

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Router as Router/Navigation
    participant Layout as Messages Layout
    participant Page as Page Client
    participant Panel as MessagesPanel
    participant Input as MessageInput

    User->>Router: select program/partner
    Router->>Layout: navigate to /messages/{id}?new=1
    Layout->>Layout: setCurrentPanel("main")
    Layout->>Page: render page-client for selection
    Page->>Page: read searchParams (?new=1) and width
    Page->>Router: router.replace(...) to remove ?new=1
    Page->>Panel: render with autoFocusComposer=true
    Panel->>Input: render with autoFocus = !isMobile || autoFocusComposer
    Input->>User: focus composer input
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • steven-tey
  • devkiran

"I hopped through code with nimble feet,
A ?new=1 carrot, oh so sweet,
Panels that open by width's tune,
Composer wakes beneath the moon,
Hooray — messages ready, neat!" 🐇✨

🚥 Pre-merge checks | ✅ 2 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (21 files):

⚔️ apps/web/app/(ee)/api/cron/payouts/balance-available/route.ts (content)
⚔️ apps/web/app/(ee)/api/track/open/route.ts (content)
⚔️ apps/web/app/(ee)/partners.dub.co/(dashboard)/messages/[programSlug]/page-client.tsx (content)
⚔️ apps/web/app/(ee)/partners.dub.co/(dashboard)/messages/layout.tsx (content)
⚔️ apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/[programSlug]/page.tsx (content)
⚔️ apps/web/app/api/domains/[domain]/transfer/route.ts (content)
⚔️ apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/messages/[partnerId]/page-client.tsx (content)
⚔️ apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/messages/layout.tsx (content)
⚔️ apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/overview-tasks.tsx (content)
⚔️ apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/payouts/payout-stats.tsx (content)
⚔️ apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/payouts/payout-table.tsx (content)
⚔️ apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/payouts/use-payout-filters.tsx (content)
⚔️ apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/billing/plan-usage.tsx (content)
⚔️ apps/web/lib/actions/partners/create-program-application.ts (content)
⚔️ apps/web/lib/actions/partners/onboard-partner.ts (content)
⚔️ apps/web/lib/swr/use-partners-count.ts (content)
⚔️ apps/web/lib/swr/use-payouts-count.ts (content)
⚔️ apps/web/lib/zod/schemas/opens.ts (content)
⚔️ apps/web/scripts/fix-broken-partner-users.ts (content)
⚔️ apps/web/ui/layout/sidebar/app-sidebar-nav.tsx (content)
⚔️ apps/web/ui/messages/messages-panel.tsx (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Mobile partner messaging fixes' is directly related to the PR's main objective of fixing messaging UI issues on smaller screens. It accurately summarizes the core changes affecting mobile messaging functionality.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch program-partner-messages
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch program-partner-messages
  • Create stacked PR with resolved conflicts
  • Post resolved changes as copyable diffs in a comment

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/messages/[partnerId]/page-client.tsx (1)

94-100: width in the dependency array will override manual panel toggles on resize.

Since width is a continuously reactive value (updates on window resize), this effect will reset isRightPanelOpen on every resize event — overriding any manual toggle the user performed (e.g., user closes the panel on a wide screen, then resizes slightly and it reopens).

If the intent is to set the initial panel state only when switching conversations, consider tracking whether the user has manually toggled and skipping the effect in that case, or removing width from the deps and using it only as a read inside the effect triggered by partnerId.

♻️ Suggested approach: only reset on conversation change
- const [isRightPanelOpen, setIsRightPanelOpen] = useState(false);
- const shouldAutoFocusComposer = searchParams.get("new") === "1";
-
- useEffect(() => {
-   if (typeof width !== "number") return;
-   setIsRightPanelOpen(width >= 960);
- }, [partnerId, width]);
+ const [isRightPanelOpen, setIsRightPanelOpen] = useState(false);
+ const shouldAutoFocusComposer = searchParams.get("new") === "1";
+
+ useEffect(() => {
+   if (typeof width !== "number") return;
+   setIsRightPanelOpen(width >= 960);
+   // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [partnerId]);

Alternatively, if you do want the panel to respond to crossing the 960 px breakpoint (not every pixel change), a cleaner approach would be to derive a boolean isDesktop = width >= 960 and depend on that instead — so the effect only fires on actual breakpoint transitions.

♻️ Alternative: depend on a breakpoint boolean
+ const isDesktop = typeof width === "number" && width >= 960;
+
  useEffect(() => {
-   if (typeof width !== "number") return;
-   setIsRightPanelOpen(width >= 960);
- }, [partnerId, width]);
+   setIsRightPanelOpen(isDesktop);
+ }, [partnerId, isDesktop]);

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant